package com.wanchuang.shengfubao.adapter;


import android.content.Context;
import android.graphics.Color;
import android.view.View;


import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.wanchuang.shengfubao.R;
import com.wanchuang.shengfubao.proto.Mystock;

import java.util.List;

public class AllocPartnerAdapter extends BaseQuickAdapter<Mystock.get_transfer_mb_list.List, BaseViewHolder> {
    public AllocPartnerAdapter(Context context, List<Mystock.get_transfer_mb_list.List> dataList) {
        super(R.layout.item_alloca_partner, dataList);
    }

    @Override
    protected void convert(BaseViewHolder helper, Mystock.get_transfer_mb_list.List item) {

        helper.setText(R.id.tv_name, item.getMemberName())
                .setText(R.id.tv_phone, item.getMemberMobile());

        if (item.getMemberMobile().equals("1")) {
            helper.getView(R.id.tv_phone).setVisibility(View.INVISIBLE);
        } else {
            helper.getView(R.id.tv_phone).setVisibility(View.VISIBLE);
        }
        if (item.getIsAgentPolicy().equals("1")) {
            helper.setVisible(R.id.tv_no_zhen, false)
                    .setVisible(R.id.iv_next, false)
                    .setTextColor(R.id.tv_name, Color.parseColor("#FF676E7D"))
                    .setTextColor(R.id.tv_phone, Color.parseColor("#FF676E7D"));
        } else {
            helper.setVisible(R.id.tv_no_zhen, true)
                    .setVisible(R.id.iv_next, false)
                    .setTextColor(R.id.tv_name, Color.parseColor("#FFB0B6C4"))
                    .setTextColor(R.id.tv_phone, Color.parseColor("#FFB0B6C4"));
        }
    }
}